// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import iosbridge from './bridgeconfig/iosbridge'
import androidbridge from './bridgeconfig/androidbridge'
import pcbridge from './bridgeconfig/pcbridge'

Vue.config.productionTip = false

// 处理依赖关系
var configBridge = function () {
  var u = navigator.userAgent 
  var isAndroid = u.indexOf('Android') > -1 || u.indexOf('Adr') > -1
  var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)
  if (isAndroid) {
    Vue.prototype.$bridge = androidbridge
  } else if (isiOS) {
    Vue.prototype.$bridge = iosbridge
  } else {
    Vue.prototype.$bridge = pcbridge
  }
}

configBridge()

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
